package com.changgou.goods.dao;

import com.changgou.goods.pojo.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface BrandMapper extends Mapper<Brand> {

    @Select("SELECT b.* FROM tb_brand b,tb_category c,`tb_category_brand` cb WHERE b.id = cb.`brand_id` AND c.id = cb.`category_id` AND c.`name`= #{categoryName} order by seq")
    List<Brand> selectListByCategoryName(@Param("categoryName")String categoryName);
}
